import { Outlet, useLocation } from "react-router-dom";
import Header from "components/ReturnHeader";
import { useMemo } from "react";

const dict: any = {
	"/super/authdeal": ["权限处理", "/super/authlist"],
	"/super/authlist": ["权限列表", "/open"],
};

export default function () {
	const { pathname } = useLocation();
	const { title, linkurl } = useMemo(() => {
		const [title, linkurl] = dict[pathname];
		return { title, linkurl };
	}, [pathname]);
	return (
		<div>
			<Header title={title} linkurl={linkurl} />
			<div className=' p-4  ' style={{ height: "calc(100vh - 4rem - 2rem - .5rem)" }}>
				<Outlet />
			</div>
		</div>
	);
}
